﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace aier.dataaccess.model
{
    [XrmEntity("new_screen", "new_screenid")]
    public class Screen: BaseModel
    {
        /// <summary>
        /// 筛选信息id
        /// </summary>
        [XrmFieldMapping("new_screenid", XrmAttributeType.UniqueIdentifier)]
        public System.Guid new_screenId { get; set; }

        /// <summary>
        /// 筛查状态
        /// 0、新建；1、发布；2、撤销；3、已完成；4、暂停；5、进行中；
        /// </summary>
        [XrmFieldMapping("new_screenstate", XrmAttributeType.XrmOptionSetValue, true)]
        public Nullable<int> new_screenstate { get; set; }

        /// <summary>
        /// 筛查类型
        /// 100000000、社区筛查；100000001、校园筛查；100000002,大学校园及圈层:100000003,大客户活动
        /// </summary>
        [XrmFieldMapping("new_screentype", XrmAttributeType.XrmOptionSetValue, true)]
        public Nullable<int> new_screentype { get; set; }


        /// <summary>
        /// 活动方式
        /// </summary>
        [XrmFieldMapping("new_propagandatype", XrmAttributeType.XrmOptionSetValue, true)]
        public Nullable<int> new_propagandatype { get; set; }

        /// <summary>
        /// 大学圈层活动方式
        /// </summary>
        [XrmFieldMapping("new_activitytype", XrmAttributeType.XrmOptionSetValue, true)]
        public Nullable<int> new_activitytype { get; set; }

        /// <summary>
        /// 学校
        /// </summary>
        [XrmFieldMapping("new_school", XrmAttributeType.EntityReference, true)]
        [XrmReferenceType("new_school", default(string))]
        public Nullable<System.Guid> new_schoolId { get; set; }

        /// <summary>
        /// 社区
        /// </summary>
        [XrmFieldMapping("new_community", XrmAttributeType.EntityReference, true)]
        [XrmReferenceType("new_community", default(string))]
        public Nullable<System.Guid> new_communityId { get; set; }

        /// <summary>
        /// 录入模式
        /// </summary>
        [XrmFieldMapping("new_templatetype", XrmAttributeType.XrmOptionSetValue, true)]
        public Nullable<int> new_templatetype { get; set; }

        /// <summary>
        /// 计划开始时间
        /// </summary>
        
        [XrmFieldMapping("new_startdate", XrmAttributeType.DateTime, true)]
        public Nullable<System.DateTime> new_startdate { get; set; }

        /// <summary>
        /// 计划完成时间
        /// </summary>
        [XrmFieldMapping("new_enddate", XrmAttributeType.DateTime, true)]
        public Nullable<System.DateTime> new_enddate { get; set; }

        /// <summary>
        /// 筛查小组
        /// </summary>
        [XrmFieldMapping("new_screenteam", XrmAttributeType.EntityReference, true)]
        [XrmReferenceType("new_screenteam", default(string))]
        public Nullable<System.Guid> new_screenteamId { get; set; }

        /// <summary>
        /// 负责人
        /// </summary>
        [XrmFieldMapping("ownerid", XrmAttributeType.EntityReference, true)]
        [XrmReferenceType("systemuser", default(string))]
        public System.Guid OwnerId { get; set; }

        /// <summary>
        /// 筛选项目
        /// </summary>
        [XrmFieldMapping("new_new_screenitem", XrmAttributeType.EntityReference, true)]
        [XrmReferenceType("new_screenitem", default(string))]
        public Nullable<System.Guid> new_new_screenitem { get; set; }

        /// <summary>
        /// 筛选项目模版
        /// </summary>
        [XrmFieldMapping("new_checkmenu", XrmAttributeType.EntityReference, true)]
        [XrmReferenceType("new_t_sc_page_element", default(string))]
        public Nullable<System.Guid> new_checkmenu { get; set; }

        /// <summary>
        /// 外联
        /// </summary>
        [XrmFieldMapping("new_outreach", XrmAttributeType.String, true)]
        public string new_outreach { get; set; }

        /// <summary>
        /// 宣讲
        /// </summary>
        [XrmFieldMapping("new_preach", XrmAttributeType.String, true)]
        public string new_preach { get; set; }

        /// <summary>
        /// 司机
        /// </summary>
        [XrmFieldMapping("new_thedriver", XrmAttributeType.String, true)]
        public string new_thedriver { get; set; }
        
        /// <summary>
        /// 筛选医生
        /// </summary>
        [XrmFieldMapping("new_screeningdoctor", XrmAttributeType.String, true)]
        public string new_screeningdoctor { get; set; }
        
        /// <summary>
        /// 筛选护士
        /// </summary>
        [XrmFieldMapping("new_screeningnurse", XrmAttributeType.String, true)]
        public string new_screeningnurse { get; set; }
        
        /// <summary>
        /// 其他
        /// </summary>
        [XrmFieldMapping("new_other", XrmAttributeType.String, true)]
        public string new_other { get; set; }

        /// <summary>
        /// 修改时间
        /// </summary>
        [XrmFieldMapping("modifiedon", XrmAttributeType.DateTime, true)]
        public Nullable<System.DateTime> ModifiedOn { get; set; }

        /// <summary>
        /// 修改人
        /// </summary>
        [XrmFieldMapping("modifiedby", XrmAttributeType.EntityReference, true)]
        [XrmReferenceType("systemuser", default(string))]
        public Nullable<System.Guid> ModifiedBy { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        [XrmFieldMapping("createdon", XrmAttributeType.DateTime, true)]
        public Nullable<System.DateTime> Createdon { get; set; }

        /// <summary>
        /// 创建人
        /// </summary>
        [XrmFieldMapping("createdby", XrmAttributeType.EntityReference, true)]
        [XrmReferenceType("systemuser", default(string))]
        public Nullable<System.Guid> Createdby { get; set; }

        /// <summary>
        /// 签到地址
        /// </summary>
        [XrmFieldMapping("new_checkinaddress", XrmAttributeType.String, true)]
        public string new_checkinaddress { get; set; }

        /// <summary>
        /// 签到人
        /// </summary>
        [XrmFieldMapping("new_checkinperson", XrmAttributeType.EntityReference, true)]
        [XrmReferenceType("systemuser", default(string))]
        public Nullable<System.Guid> new_checkinperson { get; set; }

        /// <summary>
        /// 签到时间
        /// </summary>
        [XrmFieldMapping("new_checkintime", XrmAttributeType.DateTime, true)]
        public Nullable<System.DateTime> new_checkintime { get; set; }

        /// <summary>
        /// 完成时间
        /// </summary>
        [XrmFieldMapping("new_completetime", XrmAttributeType.DateTime, true)]
        public Nullable<System.DateTime> new_completetime { get; set; }

        /// <summary>
        /// 实际派单数
        /// </summary>
        [XrmFieldMapping("new_distributenum", XrmAttributeType.Int, true)]
        public Nullable<int> new_distributenum { get; set; }

        /// <summary>
        /// 计划派单数
        /// </summary>
        [XrmFieldMapping("new_distributeplan", XrmAttributeType.Int, true)]
        public Nullable<int> new_distributeplan { get; set; }

        /// <summary>
        /// latitude
        /// </summary>
        [XrmFieldMapping("new_latitude", XrmAttributeType.String, true)]
        public string new_latitude { get; set; }

        /// <summary>
        /// new_longitude
        /// </summary>
        [XrmFieldMapping("new_longitude", XrmAttributeType.String, true)]
        public string new_longitude { get; set; }

        /// <summary>
        /// 筛查名称
        /// </summary>
        [XrmFieldMapping("new_name", XrmAttributeType.String, true)]
        public string new_name { get; set; }

        /// <summary>
        /// 计划筛查班级数
        /// </summary>
        [XrmFieldMapping("new_planscreeningclassnum", XrmAttributeType.Int, true)]
        public Nullable<int> new_planscreeningclassnum { get; set; }

        /// <summary>
        /// 计划活动人数
        /// </summary>
        [XrmFieldMapping("new_planscreeningpeople", XrmAttributeType.Int, true)]
        public Nullable<int> new_planscreeningpeople { get; set; }

        /// <summary>
        /// 合作项目
        /// </summary>
        [XrmFieldMapping("new_project", XrmAttributeType.EntityReference, true)]
        [XrmReferenceType("new_jointproject", default(string))]
        public Nullable<System.Guid> new_project { get; set; }

        /// <summary>
        /// 到场人数
        /// </summary>
        [XrmFieldMapping("new_screenpeoplenum", XrmAttributeType.Int, true)]
        public Nullable<int> new_screenpeoplenum { get; set; }

        /// <summary>
        /// 状态
        /// </summary>
        [XrmFieldMapping("statecode", XrmAttributeType.Int, true)]
        public Nullable<int> statecode { get; set; }

        /// <summary>
        /// 筛查资源
        /// </summary>
        public string[] Resources { get; set; }

    }

    public class BaseModel
    {
        /// <summary>
        /// 用户ID
        /// </summary>
        public Guid userid { get; set; }
        /// <summary>
        /// 联系人名称用于社区更新或社区创建
        /// </summary>
        public string contactname { get; set; }
    }
}
